package me.linkcn.ydtxl.server.objects;

import me.linkcn.ydtxl.server.data.DataFacade;

import java.util.List;

/**
 * Created by IntelliJ IDEA.
 * User: cmcc
 * Date: 11-8-14
 * Time: 下午10:44
 */
public class ObjectsFacade {
    protected DataFacade dataFacade;

    public ObjectsFacade(DataFacade dataFacade) {
        super();
        this.dataFacade = dataFacade;
    }

    public Account getAccountByLoginPwd(String identifier, char[] secret) {
        return this.dataFacade.getAccountByLoginPwd(identifier, secret);
    }

    public int generateGroupIdByAccountName(String accountName) {
        return this.dataFacade.generateGroupIdByAccountName(accountName);
    }

    public boolean createGroup(Group group) {
        return this.dataFacade.createGroup(group);
    }

    public List<Group> getGroupListByAccountName(String accountName) {
        return this.dataFacade.getGroupListByAccountName(accountName);
    }

    public Group getGroupByAccountNameAndGroupName(String accountName, String groupName) {
        return this.dataFacade.getGroupByAccountNameAndGroupName(accountName, groupName);
    }

    public boolean deleteGroupByAccountNameAndGroupName (String accountName, String groupName) {
        return this.dataFacade.deleteGroupByAccountNameAndGroupName(accountName, groupName);
    }
}
